From 4b7ef248f5440c038418c4e0e2b99a31908d230b Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Sat, 9 Jul 2005 13:55:54 +0000 Subject: [PATCH] added configure for external specification of md5sums dir --- Makefile | 2 ++ configure | 12 ++++++++++++ ocaml-md5sums.ml => ocaml-md5sums.ml.in | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 configure rename ocaml-md5sums.ml => ocaml-md5sums.ml.in (99%) diff --git a/Makefile b/Makefile index 4606c348..203e80bd 100644 --- a/Makefile +++ b/Makefile @@ -16,6 +16,8 @@ all: ocaml-md5sums opt: ocaml-md5sums.opt world: all opt +ocaml-md5sums.ml: ocaml-md5sums.ml.in + ./configure ocaml-md5sums: ocaml-md5sums.ml $(OCAMLC) $(patsubst %,%.cma,$(OCAML_LIBS)) -o $@ $< ocaml-md5sums.opt: ocaml-md5sums.ml diff --git a/configure b/configure new file mode 100644 index 00000000..1ebaaa3d --- /dev/null +++ b/configure @@ -0,0 +1,12 @@ +#!/bin/sh +DEFAULT="/var/lib/ocaml/3.08.3/md5sums" +if [ -z "$1" ]; then + echo "No dir provided, using default: $DEFAULT" + echo "You can override it with: ./configure [ md5sums_dir ]" + MD5SUMS_DIR="$DEFAULT" +else + MD5SUMS_DIR="$1" +fi +echo -n "Creating ocaml-md5sums.ml ... " +sed "s:@MD5SUMS_DIR@:$MD5SUMS_DIR:" < ocaml-md5sums.ml.in > ocaml-md5sums.ml +echo "done." diff --git a/ocaml-md5sums.ml b/ocaml-md5sums.ml.in similarity index 99% rename from ocaml-md5sums.ml rename to ocaml-md5sums.ml.in index b9d893d0..3aafb209 100644 --- a/ocaml-md5sums.ml +++ b/ocaml-md5sums.ml.in @@ -25,7 +25,7 @@ open Printf (** {2 Constants} *) let ocamlobjinfo = "/usr/bin/ocamlobjinfo" -let md5sums_dir = "/var/lib/ocaml/md5sums" +let md5sums_dir = "@MD5SUMS_DIR@" let md5sums_index = "MD5SUMS" let md5sums_ext = ".md5sums" let registry_file = sprintf "%s/%s" md5sums_dir md5sums_index -- 2.30.2